package com.atguigu.b_localdatetime;

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

public class Test {
    public static void main(String[] args) {
        //现在时间
        LocalDateTime now = LocalDateTime.now();
        //出生时间
        LocalDateTime of = LocalDateTime.of(1991, 1, 1,0,0,0);

        //调用until方法 -> 求时间间隔
        long days = of.until(now, ChronoUnit.DAYS);
        System.out.println("days = " + days);
    }
}
